import { get, post } from "./http";

// 判断管理员是否登录成功
export const getLoginStatus = params => post(`admin/login/status`, params);
// 判断注册是否成功
export const getregisterStatus = params =>
  post(`admin/register/status`, params);

// 查询村镇信息
export const getAllTowns = () => get(`towns/allTowns`);
// 添加村镇信息
export const setTowns = params => post(`towns/add`, params);
// 修改村镇信息
export const updateTowns = params => post(`towns/update`, params);
// 删除村镇信息
export const deleteTowns = id => get(`towns/delete?id=${id}`);

// 查询驻村干部信息
export const getAllCadre = () => get(`cadre/allCadre`);
// 添加村镇干部信息
export const setCadre = params => post(`cadre/add`, params);
// 修改驻村干部信息
export const updateCadre = params => post(`cadre/update`, params);
// 删除驻村干部信息
export const deleteCadre = id => get(`cadre/delete?id=${id}`);

// 添加村户信息
export const setVillage = params => post(`village/add`, params);
// 查询村户信息
export const getAllVillage = () => get(`village/allVillage`);

// 查询工作日志
export const getAllWorklog = () => get(`worklog/allWorklog`);
// 添加工作日志
export const setWorklog = params => post(`worklog/add`, params);
// 修改工作日志
export const updateWorklog = params => post(`worklog/update`, params);
// 删除工作日志
export const deleteWorklog = id => get(`worklog/delete?id=${id}`);

// 查询请假单
export const getAllLeaveManagement = () => get(`leave/allLeaveManagement`);
// 添加请假单
export const setLeaveManagement = params => post(`leave/add`, params);
// 修改请假单
export const updateLeaveManagement = params => post(`leave/update`, params);
// 删除请假单
export const deleteLeaveManagement = id => get(`leave/delete?id=${id}`);

// 查询走访户工作信息
export const getVisitorWork = () => get(`visitorWork/allVisitorWork`);
// 添加走访户工作信息
export const setVisitorWork = params => post(`visitorWork/add`, params);
// 修改走访户工作信息
export const updateVisitorWork = params => post(`visitorWork/update`, params);
// 删除走访户工作信息
export const deleteVisitorWork = id => get(`visitorWork/delete?id=${id}`);

// 查询村民留言
export const getVillagersMessage = () =>
  get(`villagersMessage/allVillagersMessage`);
// 添加村民留言
export const setVillagersMessage = params =>
  post(`villagersMessage/add`, params);
// 修改村民留言
export const updateVillagersMessage = params =>
  post(`villagersMessage/update`, params);
// 删除村民留言
export const deleteVillagersMessage = id =>
  get(`villagersMessage/delete?id=${id}`);

// 根据成员id查询歌曲
export const villageOfTownsId = id =>
  get(`village/villageOfTownsId?townsId=${id}`);
// 修改村户信息
export const updateVillage = params => post(`village/update`, params);
// 删除村户信息
export const deleteVillage = id => get(`village/delete?id=${id}`);

// 添加组织管理信息
export const setOrganization = params => post(`organization/add`, params);
// 查询组织管理信息
export const getAllOrganization = () =>
  get(`organization/allOrganizationDepartment`);
// 修改组织管理信息
export const updateOrganization = params => post(`organization/update`, params);
// 删除组织管理信息
export const deleteOrganization = id => get(`organization/delete?id=${id}`);

// 根据成员id查询成员id
export const memberOfOrganizationId = id =>
  get(`member/memberOfOrganizationId?organizationId=${id}`);
// 修改成员信息
export const updateMember = params => post(`member/update`, params);
// 删除成员信息
export const deleteMember = id => get(`member/delete?id=${id}`);
// 查看成员信息
export const getAllMember = () => get(`member/allMember`);

// 查询人口流动信息
export const getAllPopulationFlow = () => get(`population/allPopulationFlow`);
// 添加人口流动信息
export const setPopulationFlow = params => post(`population/add`, params);
// 修改人口流动信息
export const updatePopulationFlow = params => post(`population/update`, params);
// 删除成员信息
export const deletePopulationFlow = id => get(`population/delete?id=${id}`);
